Integrand size = 23, antiderivative size = 83 \[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \tan (e+f x) \left (a+b+b \tan ^2(e+f x)\right )^p \left (1+\frac {b \tan ^2(e+f x)}{a+b}\right )^{-p}}{f} \]
[Out]
Time = 0.10 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4231, 441, 440} \[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\tan (e+f x) \left (a+b \tan ^2(e+f x)+b\right )^p \left (\frac {b \tan ^2(e+f x)}{a+b}+1\right )^{-p} \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )}{f} \]
[In]
[Out]
Rule 440
Rule 441
Rule 4231
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+b+b x^2\right )^p}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\left (\left (a+b+b \tan ^2(e+f x)\right )^p \left (1+\frac {b \tan ^2(e+f x)}{a+b}\right )^{-p}\right ) \text {Subst}\left (\int \frac {\left (1+\frac {b x^2}{a+b}\right )^p}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \tan (e+f x) \left (a+b+b \tan ^2(e+f x)\right )^p \left (1+\frac {b \tan ^2(e+f x)}{a+b}\right )^{-p}}{f} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(1912\) vs. \(2(83)=166\).
Time = 16.25 (sec) , antiderivative size = 1912, normalized size of antiderivative = 23.04 \[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \cos ^3(e+f x) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-3+p} \left (a+b \sec ^2(e+f x)\right )^p \sin (e+f x)}{f \left (3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right ) \left (\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-2+p}}{3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {6 a (a+b) p \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^{-1+p} \sec ^2(e+f x)^{-3+p} \sin (2 (e+f x)) \tan (e+f x)}{3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {6 (a+b) (-3+p) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-3+p} \tan ^2(e+f x)}{3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}+\frac {3 (a+b) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-3+p} \tan (e+f x) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-2 \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )}{3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)}-\frac {3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) (a+2 b+a \cos (2 (e+f x)))^p \sec ^2(e+f x)^{-3+p} \tan (e+f x) \left (4 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \sec ^2(e+f x) \tan (e+f x)+3 (a+b) \left (\frac {2 b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{3 (a+b)}-2 \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )+2 \tan ^2(e+f x) \left (b p \left (-\frac {6 b (1-p) \operatorname {AppellF1}\left (\frac {5}{2},3,2-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-\frac {18}{5} \operatorname {AppellF1}\left (\frac {5}{2},4,1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )-3 (a+b) \left (\frac {6 b p \operatorname {AppellF1}\left (\frac {5}{2},4,1-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)}{5 (a+b)}-\frac {24}{5} \operatorname {AppellF1}\left (\frac {5}{2},5,-p,\frac {7}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right ) \sec ^2(e+f x) \tan (e+f x)\right )\right )\right )}{\left (3 (a+b) \operatorname {AppellF1}\left (\frac {1}{2},3,-p,\frac {3}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )+2 \left (b p \operatorname {AppellF1}\left (\frac {3}{2},3,1-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )-3 (a+b) \operatorname {AppellF1}\left (\frac {3}{2},4,-p,\frac {5}{2},-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \tan ^2(e+f x)\right )^2}\right )} \]
[In]
[Out]
\[\int \cos \left (f x +e \right )^{4} \left (a +b \sec \left (f x +e \right )^{2}\right )^{p}d x\]
[In]
[Out]
\[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right )^{4} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right )^{4} \,d x } \]
[In]
[Out]
\[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cos \left (f x + e\right )^{4} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int {\cos \left (e+f\,x\right )}^4\,{\left (a+\frac {b}{{\cos \left (e+f\,x\right )}^2}\right )}^p \,d x \]
[In]
[Out]